<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index</title>
</head>
<body>
<%String input="请输入需要的题目数量：";
String title="小学四则运算生成器";
String button="确定";
String language=(String)request.getParameter("language");

try{
if(language.equals("complex")){input="請輸入需要的題目數量：";button="確定";title="小學四則運算生成器";}
else if(language.equals("English")){input="Please input the number of Questions：";button="Go";title="Arithmetic Generator for Pupils";}
}catch(NullPointerException e){
	language="simplified";
}
%>
<h2><%out.print(title); %></h2><br/>
<form action="answerpage.jsp" method="post">
<%out.print(input); %><br/><br/>
<input type="text" name="quantity" value="3" onkeyup="value=value.replace(/[^1234567890-]+/g,'')">
<input type="hidden" name="language" value="<%out.print(language); %>">
<input type="submit" value="<%out.print(button); %>">
</form> <br/>

<form action="index.jsp" method="post">
<input type="radio" name="language" value="simplified" checked >简体中文
<br>
<input type="radio" name="language" value="complex">繁體中文
<br>
<input type="radio" name="language" value="English">English
<br/><br/>
<input type="submit" value="<%out.print(button); %>">
</form>


</body>
</html>